
#include "SceneField.h"

#include <utils/Format.h>
#include <utils/Print.h>

using namespace solar;
using namespace solar::cuda;

void SceneField::setGroundLength(float ground_length) { ground_length_ = ground_length; }
auto SceneField::getGroundLength() const -> float { return ground_length_; }
void SceneField::setGroundWidth(float ground_width) { ground_width_ = ground_width; }
auto SceneField::getGroundWidth() const -> float { return ground_width_; }
auto SceneField::getSunRay() -> std::shared_ptr<CudaSunray> { return sunray_; }
auto SceneField::getGrids() -> std::vector<std::shared_ptr<CudaGrid>>& { return grids_; }
auto SceneField::getHeliostats() -> std::vector<std::shared_ptr<CudaHeliostat>>&
{
    return heliostats_;
}
auto SceneField::getReceivers() -> std::vector<std::shared_ptr<CudaReceiver>>&
{
    return receivers_;
}

void SceneField::setSunRay(std::shared_ptr<CudaSunray> sunray) { sunray_ = sunray; }
void SceneField::addGrid(std::shared_ptr<CudaGrid> grid) { grids_.push_back(grid); }
void SceneField::addHeliostat(std::shared_ptr<CudaHeliostat> helio)
{
    heliostats_.push_back(helio);
}

void SceneField::addReceiver(std::shared_ptr<CudaReceiver> rev) { receivers_.push_back(rev); }

void SceneField::test()
{
    solar::println("========================== test SceneField begin ========================");
    solar::println(
        solar::format("\tground_length={} ground_width={}", ground_length_, ground_width_));
    solar::println(solar::format("\tgrid_size = {}, receiver_size = {}, heliostat_size = {}",
                                 grids_.size(), receivers_.size(), heliostats_.size()));

    // grids_[0]->test();

    solar::println("========================== test SceneField end   ========================");
}
